<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>个人信息</title>
	<meta name="renderer" content="webkit">	
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">	
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">	
	<meta name="apple-mobile-web-app-status-bar-style" content="black">	
	<meta name="apple-mobile-web-app-capable" content="yes">	
	<meta name="format-detection" content="telephone=no">	
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugins/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bootstrap.css" media="all">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/global.css" media="all">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/userdetail.css" media="all">
</head>
<style>


</style>
<body>
<section class="layui-larry-box">
	<div class="larry-personal">
<!-- 		<header class="larry-personal-tit">
			<span>个人信息</span>
		</header> --><!-- /header -->
		<div class="larry-personal-body clearfix">
			<form class="layui-form col-lg-4" action="" method="post">
				<div class="layui-form-item">
					<label class="layui-form-label">用户名</label>
					<div class="layui-input-block">  
						<input type="text" autocomplete="off"  class="layui-input layui-disabled" value="{$info['username']}" disabled="disabled" >
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">所属角色</label>
					<div class="layui-input-block">
						<input type="text" autocomplete="off" class="layui-input layui-disabled" value="{$info['role_name']}" disabled="disabled">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">真实姓名</label>
					<div class="layui-input-block">
						<input type="text" name="realname"  autocomplete="off" class="layui-input" value="{$info['realname']}">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">手机号码</label>
					<div class="layui-input-block">
						<input type="text" name="mphone" lay-verify="phone" autocomplete="off" class="layui-input" placeholder="输入手机号码" value="{$info['mphone']}">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">固话座机</label>
					<div class="layui-input-block">
						<input type="text" name="phone"  autocomplete="off" class="layui-input" placeholder="输入固话座机号码" value="{$info['phone']}">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">性别</label>
					<div class="layui-input-block">
						<if condition="$info['sex'] eq 1">
						  <input type="radio" name="sex" value="1" title="男" checked="">
						  <input type="radio" name="sex" value="2" title="女">
                        <elseif condition="$info['sex'] eq 2" />
                          <input type="radio" name="sex" value="1" title="男">
						  <input type="radio" name="sex" value="2" title="女" checked="">
						 <else />
                          <input type="radio" name="sex" value="1" title="男">
						  <input type="radio" name="sex" value="2" title="女">
					    </if>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">QQ号码</label>
					<div class="layui-input-block">
						<input type="text" name="qq"  lay-verify="number" autocomplete="off" class="layui-input" placeholder="输入QQ号码" value="{$info['qq']}">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">QQ昵称</label>
					<div class="layui-input-block">
						<input type="text" name="qq_nickname"  autocomplete="off" class="layui-input" placeholder="输入QQ昵称" value="{$info['qq_nickname']}">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">微信号码</label>
					<div class="layui-input-block">
						<input type="text" name="weixin"  autocomplete="off" class="layui-input" placeholder="输入微信号码" value="{$info['weixin']}">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">微信昵称</label>
					<div class="layui-input-block">
						<input type="text" name="weixin_nikname"  autocomplete="off" class="layui-input" placeholder="输入微信昵称" value="{$info['weixin_nikname']}">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">居住住址</label>
					<div class="layui-input-block">
						<input type="text" name="address"  autocomplete="off" class="layui-input" placeholder="输入居住地址" value="{$info['address']}">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">修改头像</label>
					<div class="layui-input-block">
						<input type="file" name="head" class="layui-upload-file" lay-title="修改头像吧亲！">
					</div>
				</div>

				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label">座右铭</label>
					<div class="layui-input-block">
						<textarea placeholder="路漫漫其修远兮，吾将上下而求索" name="motto" class="layui-textarea">{$info['motto']}</textarea>
						<i style="color:red;">PS:未修改任何东西强行保存会提示'失败出错'！</i>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit="" lay-filter="go">立即修改</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</section>
<script type="text/javascript" src="__PUBLIC__/plugins/layui/layui.js"></script>
<script type="text/javascript">
	layui.use(['form','upload','layer'],function(){
         var form = layui.form();
         var layer=layui.layer;
         var $ = layui.jquery;
         layui.upload({ 
             url: "{:U('Upload/index3?folder=users')}" ,//上传接口 
             ext:'jpg|jpeg|png|gif',//上传的格式
             success: function(res){
               //上传成功后的回调 
		           layer.open({
		           	 title:'消息',
		           	 content:res.yes,
		           	 shadeClose:true,
		           	 time:3000,
		           });
            } 
         });

		  //监听提交
		  form.on('submit(go)', function(data){
		    // layer.alert(JSON.stringify(data.field), {
		    //   title: '最终的提交信息'
		    // });
		    // return false; 
		     layer.confirm('修改个人信息，你确定？',{btn:['确认','取消']},function(yes){
                $.ajax({
                	url:"{:U('UserDetail/edit')}",
                	type:'post',
                	data:data.field,
                	dataType:'json',
                	success:function(res){
                       layer.msg(res.yes,{time:2000});
                	}
                });
		     },function(no){
                layer.msg('已取消操作',{time:1000});
		     });
		     return false; 
		  });

	});
</script>
</body>
</html>